• 0 Votes
    2 Posts
    266 Views
    J
    @misterlisty you already asked the same question in January.
  • 0 Votes
    9 Posts
    1k Views
    S
    @robert-hh ah ok, thank you for explaining. so I set it to 3.28 V and I am on the safe side ;) thanks
  • How do i measure the battery voltage?

    Discussion battery monitor
    4
    0 Votes
    4 Posts
    731 Views
    J
    @misterlisty If you are using a Pysense or Pytrack you don't need to use the ADC input or add a voltage divider. That's already done on the board, and you can read it using the read_battery_voltage method of the relevant library. I think it's also more accurate that the ESP32 ADC, though I haven't really compared them.
  • Can Lopy measure the battery?

    Comments & Feedback lopy battery monitor
    5
    0 Votes
    5 Posts
    1k Views
    J
    @jcaron thank you, I am using an expansion board, but I will try it whit pysense.
  • 4 Votes
    16 Posts
    4k Views
    Charly86C
    @brotherdust any chance you share the pin pad mapping on the bottom (at least RX/TX) ?
  • 0 Votes
    4 Posts
    3k Views
    ledbelly2142L
    @jmarcelino Once again, thanks for the great feedback. I was looking for a simple way to alert when the battery needs to be recharged. Looks like some simple logic could be: if voltages gets to 3.3, alert for recharge... So many LiPo batteries have differing characteristics, even among the same model/make/capacity/manufacturer. I don't think there is real value is tracking a percentage... without extensive battery testing. Simplest thing to do is just report voltage. From the example from HERE do you recommend using the following: numADCreadings = const(100) def ADCloopMeanStdDev(): adc = machine.ADC(0) adcread = adc.channel(attn=1, pin='P16') samplesADC = [0.0]*numADCreadings; meanADC = 0.0 i = 0 while (i < numADCreadings): adcint = adcread() samplesADC[i] = adcint meanADC += adcint i += 1 meanADC /= numADCreadings varianceADC = 0.0 for adcint in samplesADC: varianceADC += (adcint - meanADC)**2 varianceADC /= (numADCreadings - 1) print("%u ADC readings :\n%s" %(numADCreadings, str(samplesADC))) print("Mean of ADC readings (0-1023) = %15.13f" % meanADC) print("Mean of ADC readings (0-1400 mV) = %15.13f" % (meanADC*1400/1024)) print("Variance of ADC readings = %15.13f" % varianceADC) print("10**6*Variance/(Mean**2) of ADC readings = %15.13f" % ((varianceADC*10**6)//(meanADC**2))) print("ADC reading for Voltage (0-1400 mV) = %15.4f" % (meanADC*1400/1024)) From the ACD pin 16 voltage, the voltage is the meanACD*1400/1024 Does not seem right, the output is 4966.3634.
  • 0 Votes
    11 Posts
    3k Views
    J
    @robert-hh, the method function very well, thank you